<template>
  <el-table
    :data="tableData"
    border
    style="
      width: 80%;
      margin: 20px;
      border-radius: 8px;
      box-shadow: 5px 5px 10px rgba(98, 106, 239, 0.5);
    "
    :header-cell-style="{
      background: '#626aef !important',
      color: '#ffffff',
      border: 'none !important',
    }"
  >
    <el-table-column prop="target" label="考核条目" />
    <el-table-column prop="score" label="评分"/>
  </el-table>
</template>

<script setup>
import { ref, onBeforeMount, reactive, getCurrentInstance } from "vue";
import { getPositionScoreAssessorList } from "@/api/score";
import { addEmpScore } from "@/api/empScore";
import { ElMessage } from "element-plus";

let props = defineProps({
  empId: {
    type: String,
    required: true, //是否规定必须得有
  },
  update: {
    type: Function,
    default: () => {},
  },
  thirdId: {
    type: Number,
    required: true,
  },
  positionId: {
    type: Number,
    required: true,
  },
  type: {
    type: Number,
    required: true,
  },
});
const tableData = ref([]);
onBeforeMount(() => {
  let positionId = props.positionId;
  let assessorId = JSON.parse(localStorage.getItem("userInfo")).id;
  getPositionScoreAssessorList({ positionId, assessorId }).then((data) => {
    tableData.value = data.data;
  })
});
</script>
<style lang="scss" scoped>
.button {
  width: 120px;
  height: 40px;
  margin: 10px 220px;
  float: right;
}
</style>
